<?php

namespace yak\layui\models;

use yak\layui\helper\YakHelper;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;

/**
 * Class Yak
 * @package yak\models
 */
class Yak extends ActiveRecord
{
    public static function getDb()
    {
        $sign = self::getDbSign();
        return \Yii::$app->get($sign);
    }

    public static function getDbSign()
    {
        return YakHelper::config('yak.db', 'db');
    }

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::class,
        ];
    }
}